import { DynamicModule, Module } from '@nestjs/common';
import { QiniuCoreModule } from './qiniu-core.module';
import { QiniuOptions } from './qiniu-options.provider';
import { QiniuController } from './qiniu.controller';
import { QiniuModuleAsyncOptions } from './qiniu.interface';

@Module({})
export class QiniuModule {
  static register(options: QiniuOptions): DynamicModule {
    return {
      controllers: [QiniuController],
      module: QiniuModule,
      imports: [QiniuCoreModule.register(options)],
    };
  }
  static forRootAsync(options: QiniuModuleAsyncOptions): DynamicModule {
    return {
      controllers: [QiniuController],
      module: QiniuModule,
      imports: [QiniuCoreModule.forRootAsync(options)],
    };
  }
}
